package com.ltsw.mvpbaseproject;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.ltsw.mvpbaseproject.activity.RecyclerViewActivity;
import com.ltsw.mvpbaseproject.activity.WebViewActivity;
import com.ltsw.mvpbaseproject.baseView.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MainActivity extends BaseActivity<MainPresenter> {

    @BindView(R.id.login)
    TextView tvLogin;
    @BindView(R.id.baseAdapter)
    TextView tvAdapter;
    @BindView(R.id.webView)
    TextView tvWebView;

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        // 网络接口测试
        tvLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mPresenter.getLogin("15158132869", "12345678");
            }
        });
        // RecyclerView万能适配器测试
        tvAdapter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RecyclerViewActivity.start(MainActivity.this);
            }
        });
        // WebVIew页面测试
        tvWebView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                WebViewActivity.start(MainActivity.this);
            }
        });
    }

    @Override
    public MainPresenter getPresenter() {
        return new MainPresenter();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

}
